home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Nave / spaceambush.swf / scripts / frame_286 / PlaceObject2_596_110 / CLIPACTIONRECORD onClipEvent(load).as < prev   
Encoding:
Text File  |  2007-03-12  |  562 b   |  16 lines

  1. onClipEvent(load){
  2.    if(String(_name) != "shota")
  3.    {
  4.       cannonLength = 20;
  5.       turretpoint = _parent.tank._rotation + _parent.tank.turret._rotation - 20;
  6.       angle = turretpoint / 360 * 2 * 3.141592653589793;
  7.       xcomponent = cannonLength * Math.sin(angle);
  8.       ycomponent = (- cannonLength) * Math.cos(angle);
  9.       _X = xcomponent + _parent.tank._x;
  10.       _Y = ycomponent + _parent.tank._y;
  11.       xmove = xcomponent / cannonLength * 10;
  12.       ymove = ycomponent / cannonLength * 10;
  13.       this._rotation = turretpoint - 90;
  14.    }
  15. }
  16.